package com.mydemo.design_pattern.action_type.iterator_pattern;

import com.mydemo.design_pattern.action_type.iterator_pattern.impl.NameRepository;

/**
 * <p></p >
 *
 * @author liming1
 * @version $Id: TestDemo, v1.0 2019-09-23 10:28 liming1 Exp $
 */
public class TestDemo {

    public static void main(String[] args) {
        NameRepository nameRepository = new NameRepository(new Object[]{"aaa", "bbb", "ccc"});
        Iterator iterator = nameRepository.getIterator();
        while (true){
            if (iterator.hasNext()){
                System.out.println(iterator.next());
            }else {
                break;
            }
        }
    }
}
